﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class foreside_content : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        loadItemContent();
    }
    protected void loadItemContent() {
        //int article_id = 3;
        string list_art = "(3,4,5)";
        SqlConnection sc = new SqlConnection(ConfigurationSettings.AppSettings["mwc_con"]);
        sc.Open();
        string query = "SELECT * FROM mwc_content WHERE id IN " + list_art;
        SqlCommand scmd = new SqlCommand(query, sc);
        SqlDataReader sdr = scmd.ExecuteReader();
        while (sdr.Read()) { 
            if(sdr["id"].ToString() == "3")
            {
                lb_erhverv.Text = sdr["title"].ToString();
                article_erhverv.Text = sdr["introtext"].ToString();
            }
            if (sdr["id"].ToString() == "4")
            {
                valuar_title.Text = sdr["title"].ToString();
                valuar_introtext.Text = sdr["introtext"].ToString();
            }
            if (sdr["id"].ToString() == "5")
            {
                investering_title.Text = sdr["title"].ToString();
                investering_introtext.Text = sdr["introtext"].ToString();
            }
        }
        
    }
}
